package com.snk.back.controller;


import com.snk.back.service.SysOrderService;
import com.snk.common.pojo.JsonResult;
import com.snk.pojo.SysOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequestMapping("/order/")
@RestController
public class SysOrderController {

    @Autowired
    private SysOrderService sysOrderService;


    @RequestMapping("doFindPageObjects")
    public JsonResult doFindPageObjects(String name, Long pageCurrent){
        return new JsonResult(sysOrderService.findPageObjects(name, pageCurrent));
    }




    @RequestMapping("doFindObjectById")
    public JsonResult doFindObjectById(Integer id){
        Map<String,Object> map=
                sysOrderService.findObjectById(id);
        return new JsonResult(map);
    }



    @RequestMapping("doUpdateObject")
    public JsonResult doUpdateObject(SysOrder sysOrder){
        sysOrderService.updateObject(sysOrder);
        return new JsonResult("Update OK");
    }


}
